home *** CD-ROM | disk | FTP | other *** search
/ InterCD 2000 September / september_2000.iso / intercd / root / ^Linux / cdrtools-1.10 / lib / getdomainname.c < prev    next >
Encoding:
C/C++ Source or Header  |  1999-08-30  |  1.4 KB  |  50 lines

  1. /* @(#)getdomainname.c    1.13 99/08/30 Copyright 1995 J. Schilling */
  2. #ifndef lint
  3. static    char sccsid[] =
  4.     "@(#)getdomainname.c    1.13 99/08/30 Copyright 1995 J. Schilling";
  5. #endif
  6. /*
  7.  *    Copyright (c) 1995 J. Schilling
  8.  */
  9. /*
  10.  * This program is free software; you can redistribute it and/or modify
  11.  * it under the terms of the GNU General Public License as published by
  12.  * the Free Software Foundation; either version 2, or (at your option)
  13.  * any later version.
  14.  *
  15.  * This program is distributed in the hope that it will be useful,
  16.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18.  * GNU General Public License for more details.
  19.  *
  20.  * You should have received a copy of the GNU General Public License
  21.  * along with this program; see the file COPYING.  If not, write to
  22.  * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  23.  */
  24.  
  25. #include <mconfig.h>
  26. #include <standard.h>
  27. #include <stdxlib.h>
  28. #ifdef    HAVE_SYS_SYSTEMINFO_H
  29. #include <sys/systeminfo.h>
  30. #endif
  31. #include <libport.h>
  32.  
  33. #ifndef    HAVE_GETDOMAINNAME
  34. EXPORT    int    getdomainname    __PR((char *name, int namelen));
  35. #endif
  36.  
  37.  
  38. #if    !defined(HAVE_GETDOMAINNAME) && defined(SI_SRPC_DOMAIN)
  39.  
  40. EXPORT int
  41. getdomainname(name, namelen)
  42.     char    *name;
  43.     int    namelen;
  44. {
  45.     if (sysinfo(SI_SRPC_DOMAIN, name, namelen) < 0)
  46.         return (-1);
  47.     return (0);
  48. }
  49. #endif
  50.